package com.hzlj.position.locate.common.enums;

import com.fz.common.base.exception.PubError;
import com.fz.common.base.exception.PubException;
import lombok.Getter;

/**
 * @author lifh
 * @date 2022/10/14 16:38
 **/
@Getter
public enum DifferentiationDataType {

    //系统核查记录
    SC_POWER_OFF("sc_power_off"),
    SC_CROSS("sc_cross"),
    SC_DEMOUNT("sc_demount"),

    //定位告警处理
    POSITION_WARNING_HANDLE("position_warning_handle"),

    //定位告警通知
    POSITION_WARNING_NOTICE("position_warning_notice");

    private final String dataType;

    DifferentiationDataType(String dataType) {
        this.dataType = dataType;
    }



    public static DifferentiationDataType of(String dataType) {
        for (DifferentiationDataType type : values()) {
            if (type.getDataType().equals(dataType)) {
                return type;
            }
        }
        throw new PubException(PubError.PARAM_EMPTY_ERROR);
    }

}
